/*
 * @ProjectName: flutter_common
 * @Package: 
 * @ClassName: country_list_model.dart
 * @Description: 获取国家列表数据模型
 * @User: Page.Su
 * @Date: 2020/8/28
 * @Time: 12:25
 * @UpdateDate: 2020/8/28 12:25
 */

import 'package:flutter_su/model/base_model.dart';
import 'package:json_annotation/json_annotation.dart';

part 'country_list_model.g.dart';


@JsonSerializable()
class CountryListModel with BaseModel {

  @JsonKey(name: 'data')
  List<Data> data;

  @JsonKey(name: 'resultCode')
  int resultCode;

  @JsonKey(name: 'resultDesc')
  String resultDesc;

  CountryListModel([this.data,this.resultCode,this.resultDesc,]);

  factory CountryListModel.fromJson(Map<String, dynamic> srcJson) => _$CountryListModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CountryListModelToJson(this);

  @override
  T toModel<T>(Map<String, dynamic> srcJson) {
    return CountryListModel.fromJson(srcJson) as T;
  }

}


@JsonSerializable()
class Data extends Object {

  @JsonKey(name: 'countryCode')
  String countryCode;

  @JsonKey(name: 'countryEnname')
  String countryEnname;

  @JsonKey(name: 'countryPhoneCode')
  String countryPhoneCode;

  @JsonKey(name: 'countrySort')
  int countrySort;

  @JsonKey(name: 'countryTcname')
  String countryTcname;

  @JsonKey(name: 'countryZhname')
  String countryZhname;

  Data(this.countryCode,this.countryEnname,this.countryPhoneCode,this.countrySort,this.countryTcname,this.countryZhname,);

  factory Data.fromJson(Map<String, dynamic> srcJson) => _$DataFromJson(srcJson);

  Map<String, dynamic> toJson() => _$DataToJson(this);

}


